let arr = [];
for(let i=0;i<100;i++){
    arr.push(i);
}

console.log(arr.slice(-50));